﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SQLite;
using System.Diagnostics;
using System.Data;

namespace dotnetsqllite
{
    public class DAOSQLlite : IDAO
    {
        private SQLiteConnection _conection;

        public SQLiteConnection Connection
        {
            get { return _conection; }
            set { _conection = value; }
        }

        public DAOSQLlite()
        {

        }

        public DAOSQLlite(String ConnString)
        {
            Connection = new SQLiteConnection();
            Connection.ConnectionString = ConnString;
        }

        public void SetConnection(string ConnString)
        {
            Connection = new SQLiteConnection();
            Connection.ConnectionString = ConnString;
        }

        public bool OpenConnection()
        {
            Connection.Open();
            if (Connection.State == ConnectionState.Open)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
    }
}
